Feature: Book Genie Mode - Automated Testing with Detailed Reporting
File name: BookGenie.feature
Relative path: features/BookGenie.feature
Scenario Outline: Book Genie Response Validation with Citation Verification
When
I open the Creative Workspace login page
00:00:01.367
Then
I should see the homepage
00:00:00.049
When
I click on the mode selection dropdown
00:00:02.659
Then
I can see the "BookGenieQA" mode
00:00:00.014
And
I select the "BookGenieQA" mode
00:00:04.553
Then
I type "Suggest 5 books on christmas" on chat input element
00:00:31.081
And
I wait for AI to complete thinking
00:01:03.799
And
I validate the response is visible for "Suggest 5 books on christmas"
00:00:00.008
And
I extract book data from BookGenie response
00:00:00.008
And
I save BookGenie book data to Excel file for query "Suggest 5 books on christmas"
00:00:00.000
+ Show Error
Error: No book data extracted from BookGenie response.
at CustomWorld.(anonymous) (/home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:46:15)
at /home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:8:71
at __awaiter (/home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:4:12)
at CustomWorld.(anonymous) (/home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:59:12)
And
I validate each book individually against Excel file for query "Suggest 5 books on christmas"
0s
And
I validate that reason texts match citation texts with 80% similarity
0s
And
I generate detailed citation validation report
0s
Then
I verify database connectivity
0s
And
database should contain 10032 books
0s
And
I validate extracted books individually against database
0s
And
I validate BookGenie response relevance with AI for query "Suggest 5 books on christmas"
0s
Then
I should see book cards
0s
And
I extract detailed content from the book card
0s
And
I extract expected data from the left-side chat panel
0s
And
I validate book titles of all cards against chat data
0s
And
I validate authors of all cards against chat data
0s
And
I validate relevance scores of all cards against chat data
0s
And
I validate why match reasons of all cards against chat data
0s
And
I validate all card contents comprehensively against chat data
0s
=== SCENARIO LOGS: Book Genie Response Validation with Citation Verification === [11:15:07 AM] Navigating to Creative Workspace login page [11:15:08 AM] Homepage visibility: false [11:15:08 AM] ℹ️ Clicking on mode selection dropdown [11:15:11 AM] ✅ Mode selection dropdown clicked successfully [11:15:11 AM] ℹ️ Checking visibility of mode: BookGenieQA [11:15:11 AM] ✅ Mode "BookGenieQA" is visible [11:15:11 AM] ℹ️ Selecting mode: BookGenieQA [11:15:11 AM] ✅ Mode "BookGenieQA" selected successfully [11:15:13 AM] ℹ️ Waiting for mode transition to complete [11:15:15 AM] ℹ️ Typing query: "Suggest 5 books on christmas" [11:15:45 AM] ⚠ ⚠Book Genie mode did not loaded [11:15:45 AM] ℹ️ Preparing to type query: "Suggest 5 books on christmas" [11:15:45 AM] ℹ️ Waiting for chat input to be visible [11:15:45 AM] ℹ️ Clearing chat input [11:15:45 AM] ℹ️ Typing query: "Suggest 5 books on christmas" [11:15:46 AM] ℹ️ Pressing Enter to submit query [11:15:46 AM] ✅ Query submitted successfully: "Suggest 5 books on christmas" [11:15:46 AM] ℹ️ Waiting for AI to complete thinking... [11:15:46 AM] 📋 WAITING FOR AI RESPONSE [11:15:46 AM] ℹ️ Looking for AI thinking indicator... [11:15:46 AM] ℹ️ Waiting for thinking indicator to appear (max 2 minutes) [11:15:48 AM] ✅ ✓ AI thinking indicator appeared - AI is processing the request [11:15:48 AM] ℹ️ Waiting for thinking indicator to disappear (max 5 minutes) [11:15:51 AM] ✅ ✓ AI thinking completed - Response should be ready [11:15:51 AM] ℹ️ 🔍 Checking for "None of the above, just" option... [11:15:51 AM] ℹ️ ✓ "None of the above, just" option found - looking for sibling span to click [11:15:51 AM] ℹ️ ✓ Found clickable span - preparing to click [11:15:51 AM] ℹ️ Clicking on span with text: "+Search through the HarperCollins book catalog for Suggest 5 books on christmas" [11:15:51 AM] ✅ ✅ Clicked on "None of the above, just" option span [11:15:51 AM] ℹ️ ⏳ Waiting for AI to process "None of the above, just" selection... [11:15:53 AM] ℹ️ ✓ AI thinking indicator appeared after "None of the above, just" selection [11:16:41 AM] ✅ ✅ AI thinking completed after "None of the above, just" selection [11:16:47 AM] ✅ ✅ "None of the above, just" handling completed successfully [11:16:47 AM] 📊 "None of the above" option was handled successfully [11:16:47 AM] ℹ️ Allowing additional time for response rendering [11:16:50 AM] ✅ AI response wait process completed [11:16:50 AM] ℹ️ Validating response for query: "Suggest 5 books on christmas" [11:16:50 AM] 📋 VALIDATING RESPONSE FOR QUERY: "Suggest 5 books on christmas" [11:16:50 AM] ℹ️ Locating the latest response in chat [11:16:50 AM] ℹ️ Waiting for response to be visible (max 30 seconds) [11:16:50 AM] ✅ Response received - Length: 3248 characters [11:16:50 AM] ℹ️ Response preview: Question Type: Book Metadata — AnalyzedWatch Me WorkLet me connect the dots for you...Retrieving Re... [11:16:50 AM] ℹ️ Extracting book data from response... [11:16:50 AM] 📋 EXTRACTING BOOK DATA FROM RESPONSE [11:16:50 AM] ℹ️ Locating BookGenie response container [11:16:50 AM] ℹ️ Extracting HTML content from response [11:16:50 AM] ℹ️ HTML content extracted - Length: 39307 characters [11:16:50 AM] ℹ️ Parsing HTML to extract book data [11:16:50 AM] ✅ SUCCESSFULLY EXTRACTED 0 BOOKS [11:16:50 AM] 📋 EXTRACTED BOOKS SUMMARY [11:16:50 AM] 📊 Total books extracted: 0 [11:16:50 AM] 📊 Average relevance score: 0% [11:16:50 AM] ✅ Extracted 0 books from response === END LOGS ===
Scenario Logs: Book Genie Response Validation with Citation Verification
[11:15:07 AM] Navigating to Creative Workspace login page
[11:15:08 AM] Homepage visibility: false
[11:15:08 AM] ℹ️ Clicking on mode selection dropdown
[11:15:11 AM] ✅ Mode selection dropdown clicked successfully
[11:15:11 AM] ℹ️ Checking visibility of mode: BookGenieQA
[11:15:11 AM] ✅ Mode "BookGenieQA" is visible
[11:15:11 AM] ℹ️ Selecting mode: BookGenieQA
[11:15:11 AM] ✅ Mode "BookGenieQA" selected successfully
[11:15:13 AM] ℹ️ Waiting for mode transition to complete
[11:15:15 AM] ℹ️ Typing query: "Suggest 5 books on christmas"
[11:15:45 AM] ⚠ ⚠Book Genie mode did not loaded
[11:15:45 AM] ℹ️ Preparing to type query: "Suggest 5 books on christmas"
[11:15:45 AM] ℹ️ Waiting for chat input to be visible
[11:15:45 AM] ℹ️ Clearing chat input
[11:15:45 AM] ℹ️ Typing query: "Suggest 5 books on christmas"
[11:15:46 AM] ℹ️ Pressing Enter to submit query
[11:15:46 AM] ✅ Query submitted successfully: "Suggest 5 books on christmas"
[11:15:46 AM] ℹ️ Waiting for AI to complete thinking...
[11:15:46 AM] 📋 WAITING FOR AI RESPONSE
[11:15:46 AM] ℹ️ Looking for AI thinking indicator...
[11:15:46 AM] ℹ️ Waiting for thinking indicator to appear (max 2 minutes)
[11:15:48 AM] ✅ ✓ AI thinking indicator appeared - AI is processing the request
[11:15:48 AM] ℹ️ Waiting for thinking indicator to disappear (max 5 minutes)
[11:15:51 AM] ✅ ✓ AI thinking completed - Response should be ready
[11:15:51 AM] ℹ️ 🔍 Checking for "None of the above, just" option...
[11:15:51 AM] ℹ️ ✓ "None of the above, just" option found - looking for sibling span to click
[11:15:51 AM] ℹ️ ✓ Found clickable span - preparing to click
[11:15:51 AM] ℹ️ Clicking on span with text: "+Search through the HarperCollins book catalog for Suggest 5 books on christmas"
[11:15:51 AM] ✅ ✅ Clicked on "None of the above, just" option span
[11:15:51 AM] ℹ️ ⏳ Waiting for AI to process "None of the above, just" selection...
[11:15:53 AM] ℹ️ ✓ AI thinking indicator appeared after "None of the above, just" selection
[11:16:41 AM] ✅ ✅ AI thinking completed after "None of the above, just" selection
[11:16:47 AM] ✅ ✅ "None of the above, just" handling completed successfully
[11:16:47 AM] 📊 "None of the above" option was handled successfully
[11:16:47 AM] ℹ️ Allowing additional time for response rendering
[11:16:50 AM] ✅ AI response wait process completed
[11:16:50 AM] ℹ️ Validating response for query: "Suggest 5 books on christmas"
[11:16:50 AM] 📋 VALIDATING RESPONSE FOR QUERY: "Suggest 5 books on christmas"
[11:16:50 AM] ℹ️ Locating the latest response in chat
[11:16:50 AM] ℹ️ Waiting for response to be visible (max 30 seconds)
[11:16:50 AM] ✅ Response received - Length: 3248 characters
[11:16:50 AM] ℹ️ Response preview: Question Type: Book Metadata — AnalyzedWatch Me WorkLet me connect the dots for you...Retrieving Re...
[11:16:50 AM] ℹ️ Extracting book data from response...
[11:16:50 AM] 📋 EXTRACTING BOOK DATA FROM RESPONSE
[11:16:50 AM] ℹ️ Locating BookGenie response container
[11:16:50 AM] ℹ️ Extracting HTML content from response
[11:16:50 AM] ℹ️ HTML content extracted - Length: 39307 characters
[11:16:50 AM] ℹ️ Parsing HTML to extract book data
[11:16:50 AM] ✅ SUCCESSFULLY EXTRACTED 0 BOOKS
[11:16:50 AM] 📋 EXTRACTED BOOKS SUMMARY
[11:16:50 AM] 📊 Total books extracted: 0
[11:16:50 AM] 📊 Average relevance score: 0%
[11:16:50 AM] ✅ Extracted 0 books from response